<?php
 namespace Model;

 use Zend\ServiceManager\ServiceLocatorAwareInterface;
 use Zend\ServiceManager\ServiceLocatorInterface;
 use Zend\ServiceManager\ServiceManager;


 class AbstractModel {
     public function toArray(){
         $result = get_object_vars($this);
         return $result;
     }

     public function exchangeArray($data){
         foreach ($data as $key => $val) {
             $this->$key= (!empty($val)) ? $val : null;
         }
     }

 }